﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="ShowTotalWork.aspx.cs" Inherits="SoftWareLab_Project.ShowTotalWork" %>
<asp:Content ID="HeaderContent" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    <div style="font-size: 18px;background: darkorange">สรุปรายละเอียดการประเมิน</div>
    <div align="center">
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
            ContextTypeName="SoftWareLab_Project.DataFDDataContext" EntityTypeName="" 
            TableName="TB_FACULTies">
        </asp:LinqDataSource>
        <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
            ContextTypeName="SoftWareLab_Project.DataFDDataContext" EntityTypeName="" 
            Select="new (ID_DEPARTMENT, NAME_DEPARTMENT, ID_FACULTY)" 
            TableName="TB_DEPARTMENTs" Where="ID_FACULTY == @ID_FACULTY">
            <WhereParameters>
                <asp:ControlParameter ControlID="DropDownList1" DefaultValue="0" 
                    Name="ID_FACULTY" PropertyName="SelectedValue" Type="Int32" />
            </WhereParameters>
        </asp:LinqDataSource>
    </div> 
    <div align="center">
        <asp:Label ID="Label1" runat="server" Text="ค้นหาจากชื่อ"></asp:Label>
        <asp:TextBox ID="txtSertFName" runat="server"></asp:TextBox>  
        <asp:Label ID="lb2" runat="server" Text="คณะ"></asp:Label>
        <asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="True" 
            AutoPostBack="True" DataSourceID="LinqDataSource1" DataTextField="NAME_FACULTY" 
            DataValueField="ID_FACULTY" 
            onselectedindexchanged="DropDownList1_SelectedIndexChanged">
            <asp:ListItem Value="0">-- เลือกคณะ --</asp:ListItem>
        </asp:DropDownList>
        <asp:Label ID="lb3" runat="server" Text="แผนก"></asp:Label>
        &nbsp;<asp:DropDownList ID="DropDownList2" runat="server" 
            AppendDataBoundItems="True" AutoPostBack="True" DataSourceID="LinqDataSource2" 
            DataTextField="NAME_DEPARTMENT" DataValueField="ID_DEPARTMENT">
            <asp:ListItem Value="0">-- เลือกแผนก --</asp:ListItem>
        </asp:DropDownList>
        &nbsp;
        <asp:Button ID="btSert" runat="server" Text="ค้นหา" Width="100px" 
            onclick="btSert_Click" style="height: 26px" />
        <br />
        <asp:Label ID="lbWarnNo" runat="server" Text="....ไม่มีข้อมูล...." 
            Visible="False" ForeColor="Red"></asp:Label>    
    </div>
    <div align="center">
    <asp:GridView ID="Gv_showData" runat="server" Width="100%" 
            AutoGenerateColumns="False" BackColor="#DEBA84" BorderColor="#DEBA84" 
            BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" 
            onrowcommand="Gv_showData_RowCommand">
        <Columns>
            <asp:BoundField DataField="NAME" HeaderText="ชื่อ" />
            <asp:BoundField DataField="LASTNAME" HeaderText="นามสกุล" />
            <asp:BoundField DataField="USER_NAME" HeaderText="ชื่อในระบบ" />
            <asp:BoundField DataField="TERM" HeaderText="ครั้งที่" />
            <asp:BoundField DataField="YEAR" HeaderText="ปีการศึกษา" />
            <asp:TemplateField HeaderText="รายละเอียด">
                <ItemTemplate>
                    <asp:LinkButton ID="lbDetail" CommandName="cmdDetail" ToolTip="ดูข้อมูล" CommandArgument='<%#Eval("NO_ID") %>' runat="server">รายละเอียด</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
        <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
        <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
        <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
        <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#FFF1D4" />
        <SortedAscendingHeaderStyle BackColor="#B95C30" />
        <SortedDescendingCellStyle BackColor="#F1E5CE" />
        <SortedDescendingHeaderStyle BackColor="#93451F" />
    </asp:GridView>
    </div> 
    
</asp:Content>
